<template>
    <div class="search">
     <span @click="$router.push('/citylist')">{{whereNow.label}}<van-icon name="arrow-down" /></span>
     <van-search   v-model="searchValue" placeholder="请输入小区或地址" />
    </div>
</template>

<script>
import { getToken } from '@/utils/cityStorage'
export default {
  data () {
    return {
      whereNow: '',
      searchValue: ''
    }
  },
  created () {
    if (getToken()) {
      this.whereNow = JSON.parse(getToken())
    } else {
      this.whereNow = {
        label: '上海',
        value: 'AREA|dbf46d32-7e76-1196',
        pinyin: 'shanghai',
        short: 'sh'
      }
    }
  }
}
</script>

<style lang="less" scoped>

 .search{
  display: flex;
  justify-content: center;
  height: 34px;
    span{
      width: 70px;
      height: 34px;
      line-height: 34px;
      text-align: center;
      background-color: #fff;
      border-right: #999;
      color: #333;
      font-size: 14px;
    }
 .van-search{
      padding: 0;
      width:230px;
    }

}
</style>
